/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package testalgorithm;

import java.util.ArrayList;

/**
 *
 * @author haoliang.donghl
 */
public class BatTest {


    public static void main(String[] args) {
        ArrayList<String> results = new ArrayList<String>();
        String[] dictionary = {"autotest", ""};
        int s1 = 0, s2 = 0;
        int t1 = 0, t2 = 0;
        for (int i = 0; i < 500; i++){
            GenerateInput.main(dictionary);

            BagAlgorithm.main(dictionary);
            CheckResult.main(dictionary);
            results.add(dictionary[1]);
            t1 = Integer.parseInt(dictionary[1]);

            OrignAlgorithm.main(dictionary);
            CheckResult.main(dictionary);
            results.add(dictionary[1]);
            t2 = Integer.parseInt(dictionary[1]);

            if (t1 < t2) s1++;
            if (t1 > t2) s2++;
            System.out.println(i);
        }

        System.out.println("*******************************");
        for (int i = 0; i < results.size(); i+= 2){
            System.out.print(results.get(i));
            System.out.print(":");
            System.out.println(results.get(i + 1));
        }
        System.out.println("*******************************");
        System.out.println(s1);
        System.out.println(s2);
    }
}
